package dto

type RoleAdd struct {
	Name string `json:"name" form:"name" binding:"required,max=10" required_msg:"角色名为必填,最大使用10个字符" validate:"required"`
	Desc string `json:"desc" form:"desc" binding:"max=20" required_msg:"desc最大使用20个字符" validate:"min=2,max=20"`
}

// BUG 请求POST URI与Param是数组时会就报 "Key: 'IRolesList.Roles' Error:Field validation for 'Roles' failed on the 'required' tag,%!w(\u003cnil\u003e)"
type IRolesList struct {
	Roles []int `form:"roles" binding:"required" required_msg:"roles,字段不能为空[]int!"`
	// Id    uint  `uri:"id" json:"id" binding:"required" required_msg:"id为必填项目"`
}

type IRoleUpdata struct {
	ID   uint   `form:"id" json:"id" binding:"required" required_msg:"id 为必填项目" validate:"required,max=10"`
	Name string `json:"name" form:"name" binding:"required,max=10" required_msg:"角色名为必填,最大使用10个字符" validate:"required"`
	Desc string `json:"desc" form:"desc" binding:"required" required_msg:"desc最大使用20个字符" validate:"required,max=60"`
}

type IroleUdataList struct {
	Roles []IRoleUpdata `json:"roles" form:"roles" binding:"required" required_msg:"roles 为必填项目!" validate:"required,dive"`
}
